package com.example.myapplication;

import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * Created by Quincy on 2018/3/30.
 */

public class TestFragment extends Fragment {
    static int count =0;
    @Override
    public void onAttach(Context context) {
        Log.e("MainApp","TestFragment onAttach context...");
        super.onAttach(context);
    }

    @Override
    public void onAttach(Activity activity) {
        Log.e("MainApp","TestFragment onAttach activity...");
        super.onAttach(activity);
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        Log.e("MainApp","TestFragment onCreate ...");
        super.onCreate(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        Log.e("MainApp","TestFragment onCreateView ...");
        TextView textView=new TextView(getActivity());
        textView.setText("fragment"+count);
        count++;
        return textView;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        Log.e("MainApp","TestFragment onActivityCreated ...");
        super.onActivityCreated(savedInstanceState);
    }

    @Override
    public void onStart() {
        Log.e("MainApp","TestFragment onStart ...");
        super.onStart();
    }

    @Override
    public void onResume() {
        Log.e("MainApp","TestFragment onResume ...");
        super.onResume();
    }

    @Override
    public void onPause() {
        Log.e("MainApp","TestFragment onPause ...");
        super.onPause();
    }

    @Override
    public void onStop() {
        Log.e("MainApp","TestFragment onStop ...");
        super.onStop();
    }

    @Override
    public void onDestroyView() {
        Log.e("MainApp","TestFragment onDestroyView ...");
        super.onDestroyView();
    }

    @Override
    public void onDestroy() {
        Log.e("MainApp","TestFragment onDestroy ...");
        super.onDestroy();
    }

    @Override
    public void onDetach() {
        Log.e("MainApp","TestFragment onDetach ...");
        super.onDetach();
    }

}
